
#include <sys/cdefs.h>

#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <assert.h>
#include <string.h>
#else
#include <lib/libkern/libkern.h>
#endif

#undef strcmp

/*
 * Compare strings.
 */
int
strcmp(const char *s1, const char *s2)
{

	_DIAGASSERT(s1 != NULL);
	_DIAGASSERT(s2 != NULL);

	while (*s1 == *s2++)
		if (*s1++ == 0)
			return (0);
	return (*(const unsigned char *)s1 - *(const unsigned char *)--s2);
}
